import React, { useEffect, useState } from 'react'
import axios from '../../api/api'
import Item from './compument/Item'
function Index() {
    const [list,setList]=useState([])
    const getDatalist=async()=>{
        const res=await axios.get('/api/list')
        console.log(res.data.data)
        setList(res.data.data)
    }
    useEffect(()=>{
        getDatalist()
    },[])
  return (
    <div>
      {
        list.map((v,i)=>{
        return <Item key={i} v={v}></Item>
        })
      }
    </div>
  )
}

export default Index
